﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace XiAnAirport.Models
{
    public class MqttDataInfo
    {

    }

    public class DeviceStatusTotal
    {
        public long msgid { get; set; }//消息id
        public string updateTime { get; set; }//上报时间
        public int normalTotal { get; set; }//正常设备总量
        public int faultTotal { get; set; }//故障设备总量
        public int maintenanceTotal { get; set; }//维保设备总量
        public int offlineTotal { get; set; }//离线设备总量
        public int deviceTotal { get; set; }//所有设备总量
    }

    public class TodayProcess
    {
        public long msgid { get; set; }//消息id
        public string updateTime { get; set; }//上报时间
        public int inspectionTotal { get; set; }//巡检总数
        public int maintenanceTotal { get; set; }//维保总量
        public int faultTotal { get; set; }//故障总量
        public int inspectionCompleted { get; set; }//巡检完成数量
        public int maintenanceCompleted { get; set; }//维保完成数量
        public int faultCompleted { get; set; }//故障完成数量
    }

    public class TodayRuntime
    {
        public long msgid { get; set; }//消息id
        public string updateTime { get; set; }//上报时间
        public double runtime { get; set; }//运行时长
    }

    public class FaultStatistics
    {
        public long msgid { get; set; }//消息id
        public string updateTime { get; set; }//上报时间
        public int faultTotal { get; set; }//故障累计次数
        public int faultToday { get; set; }//当日故障次数
    }

    public class FaultRecordReport
    {
        public long msgid { get; set; }//消息id
        public int id { get; set; }
        public string updateTime { get; set; }//上报时间
        public string elevatorName { get; set; }//设备名称
        public string elevatorNo { get; set; }//设备编码
        public string internalNo { get; set; }//内部编码
        public string elevatorType { get; set; }//设备类型（垂直梯、扶梯、步道梯）
        public string areaName { get; set; }//设备位置
        public string faultContent { get; set; }//故障名称
        public string faultType { get; set; }//故障类型
        public string faultCode { get; set; }//故障代码
        public string faultReason { get; set; }//故障原因
        public string faultTime { get; set; }//故障产生时间
        public string manufacturer { get; set; }//厂商
        public string mainAreaName { get; set; }//父区域名称
        public string faultEndTime { get; set; }//故障结束时间
    }

    public class KoneFaultReport
    {
        public string LoginName { get; set; }
        public string Reporttime { get; set; }
        public string opcNO { get; set; }
        public string Fault_Type { get; set; }
        public string Fault_Cause { get; set; }
        public int IsTiring { get; set; }

    }

    public class KoneDeviceStateSync
    {
        public string updateTime { get; set; }//上报时间
        public string opcNO { get; set; }//内部编码
        public int Car_position { get; set; }//物理楼层
        public string Car_door { get; set; }//门状态:0=open;1=opening;2=close;3=closing 
        public int Moving_direction { get; set; }//方向:0=down;1=up;2=none
        public int Elevator_control_status { get; set; }//电梯模式
        public int Full_load_alarm { get; set; }//0=正常;1=满载;2=超载
        public int Car_load { get; set; }//负载0-150，% of Nominal Load 
        public string CarCall { get; set; }//轿内呼叫
        public string Landing_call_respond_up { get; set; }//外呼-上召 
        public string Landing_call_respond_down { get; set; }//外呼-下召
        public int Faults { get; set; }//故障
        public int Alarm_bell { get; set; }//困人，0=无，1=困人
        public int Elevator_running_state { get; set; }//运行状态:1=正常速度;2=减速;5=重新调平;6=站立
    }

    public class mqttdata
    {
        public int id { get; set; }
        public string topicType { get; set; }
        public string dataType { get; set; }//数据类型
        public string manufacturerId { get; set; }//厂商id
        public string manufacturer { get; set; }//厂商名称
        public double dataNum { get; set; }//数据内容
    }

    public class RemoteLockLadderInfo
    {
        public string updateTime { get; set; }//上报时间
        public string opcNO { get; set; }//内部编码
        public int LockLadder { get; set; }//锁梯 0=无, 1=锁梯
    }

    public class HomePush
    {
        public List<DeviceStatusData> deviceStatusData { get; set; }//各个厂商设备数量
        public TodayProcessData todayProcessData { get; set; }//今日代办
        public TodayRuntimeData todayRuntimeDatas { get; set; }//运行时长
        public List<FaultRecordReport> faultRecordReportslist { get; set; }//今日故障记录
        public List<FaultStatisticsData> faultStatisticsDatas { get; set; }//故障统计
        public List<Notification> notifications { get; set; }//通知公告
        public DeviceInfoData DeviceInfoData { get; set; }//设备数量
    }

    public class KoneHomePush
    {
        public TodayProcessData todayProcessData { get; set; }//今日代办
        public Operation operation { get; set; }//运行情况
        public List<FaultRecordReport> faultRecordReportslist { get; set; }//今日故障记录
        public List<AreaDeviceNum> areaDeviceNums { get; set; }//区域设备数量
        public DeviceInfoData DeviceInfoData { get; set; }//设备数量
        public List<ElevatorState> stateList { get; set; }//设备状态
    }

    public class DeviceState
    {
        public string elevatorName { get; set; }//设备名称
        public string areaName { get; set; }//区域名称
        public int deviceState { get; set; }//设备状态：1=未连接,2=正常,3=一般故障,4=紧急故障,5=保养,6=维修
    }

    public class AreaDeviceNum
    {
        public string areaName { get; set; }//区域名称
        public int DeviceNum { get; set; }//设备数量
        public int id { get; set; }//id
        public int mainAreaId { get; set; }//上级区域id
    }

    public class Operation
    {
        public int FailureFrequency { get; set; }//故障次数
        public int Runs { get; set; }//运行次数
        public double RunTime { get; set; }//运行时间
    }
    public class DeviceInfoData//设备数量
    {
        public int deviceTotal { get; set; }//设备总数
        public int normalTotal { get; set; }//正常设备总量
        public int faultTotal { get; set; }//故障设备数量
        public int maintenanceTotal { get; set; }//维保设备总量
        public int offlineTotal { get; set; }//离线设备总量
    }

    public class AreaDeviceInfoData//设备数量
    {
        public int deviceTotal { get; set; }//设备总数
        public int normalTotal { get; set; }//正常设备总量
        public int faultTotal { get; set; }//故障设备数量
        public int maintenanceTotal { get; set; }//维保设备总量
        public int offlineTotal { get; set; }//离线设备总量
    }

    public class devicevalue
    {
        public string dataType { get; set; }
        public int dataNum { get; set; }
    }

    public class DeviceStatusData
    {
        public string manufacturer { get; set; }//厂商
        public int DeviceSum { get; set; }//设备总数
        public int normal { get; set; }//正常设备总量
    }

    /*   public class DeviceStatusData//设备数量
       {
           public string manufacturer { get; set; }//厂商
           public int DeviceSum { get; set; }//设备总数
           public int normal { get; set; }//正常设备总量
           public int fault { get; set; }//故障设备数量
           public int maintenance { get; set; }//维保设备总量
           public int offline { get; set; }//离线设备总量
       }*/
    public class TodayProcessData
    {
        public string manufacturer { get; set; }//厂商
        public int inspection { get; set; }//巡检数量
        public int maintenance { get; set; }//维保数量
        public int fault { get; set; }//故障数量
        public int inspectionCompleted { get; set; }//巡检完成数量
        public int maintenanceCompleted { get; set; }//维保完成数量
        public int faultCompleted { get; set; }//故障完成数量
    }
    public class TodayRuntimeData
    {
        public string manufacturer { get; set; }//厂商
        public double runtime { get; set; }
    }
    public class FaultStatisticsData
    {
        public string manufacturer { get; set; }//厂商
        public int faultTotal { get; set; }//故障累计次数
        public int faultToday { get; set; }//当日故障次数
    }
    public class Notification
    {
        public string updateTime { get; set; }//时间
        public string title { get; set; }//标题
        public string content { get; set; }//内容
    }

    public class PromptData
    {
        public int inspectannually { get; set; }//阈值预警
        public int fault { get; set; }//故障数量
        public int earlywarning { get; set; }//年检提醒
    }

    public class KoneDeviceTemperature
    {
        public string opcNO { get; set; }
        public string Samplingtime { get; set; }
        public string temperaturevalue { get; set; }
    }

    public class MessageConfirmInfo
    {
        public string updateTime { get; set; }
        public long msgid { get; set; }
        public int code { get; set; }
    }

    public class ThirdPartyData
    {
        public string dataType { get; set; }
        public object data { get; set; }
    }

    public class WebSocketType
    {
        public string type { get; set; }
       // public object context { get; set; }
    }

    public class RocketRegInfo
    {
        public string Method { get; set; }
        public string RegisterCode { get; set; }
        public string RequestId { get; set; }
    }

    public class ConsumeInfo
    {
        public string Method { get; set; }
        public string Topic { get; set; }
        public string Tag { get; set; }
        public string Group { get; set; }
        public string AccessKey { get; set; }
        public string SecretKey { get; set; }
        public string NamesrvAddr { get; set; }
        public bool UseTLS { get; set; }
        public string RequestId { get; set; }
    }

    public class ProduceInfo
    {
        public string command { get; set; }
        public string topic { get; set; }
        public string tag { get; set; }
        public string group { get; set; }
        public string msg { get; set; }
    }

    public class ConsumeMessageInfo
    {
        public string topic { get; set; }
        public string msg { get; set; }
    }

    public class ShareData
    {
        public string type { get; set; }
        public object message { get; set; }
    }

}
